package mysql

import (
	"gorm.io/gorm"
	"time"
)

// Member 会员充值表
type Member struct {
	gorm.Model
	UserId    int       `gorm:"type:tinyint;not null;comment:用户ID"`
	Amount    float64   `gorm:"decimal(10,2);not null;comment:充值金额"`
	PayType   string    `gorm:"varchar(3);not null;comment:支付方法 支付宝 微信"`
	PayStatus string    `gorm:"varchar(3);not null;comment:支付状态 已支付 未支付"`
	PayTime   time.Time `json:"pat_time"`
	Duration  string    `gorm:"type:varchar(20);not null;comment:会员剩余时长 1-1天 2-2天"`
}

func (m *Member) Add() error {
	return DB.Create(&m).Error
}
